/*
 * IndexStrategy.cpp
 *
 *  Created on: 03/10/2009
 *      Author: nik0l4z
 */

#include "../Strategies/Index/IndexStrategy.h"
#include "../Externa/Clave.h"

IndexStrategy::IndexStrategy() {
}

IndexStrategy::~IndexStrategy() {
}

void IndexStrategy::saludar(){
  cout << "Soy una estrategia indice" << endl;
}

bool IndexStrategy::checkUniqueness(Clave *clave, Dato* dato){
	cout << "IndexStrategy::checkUniqueness | Black Hole Pattern " << endl;
	return true;
}

void IndexStrategy::updateIndex(int fileReference,Clave*clave,Dato *dato){
	cout << "IndexStrategy::updateIndex | Black Hole Pattern " << endl;
}

int IndexStrategy::getStorageReferenceByKey(Clave *clave){
	cout << "IndexStrategy::getStorageReference | Black Hole Pattern " << endl;
	return 0;
}
int IndexStrategy::deleteKey(Clave *clave){
	cout << "IndexStrategy::deleteKey | Black Hole Pattern " << endl;
	return 0;
}


/// SE AGREGA PUNTERO A ESTATEGIA DE ALMACENAMIENTO SEGUN FUE CONVERSADO

void IndexStrategy::SetStorageStrategy(StorageStrategy *storage)
{

	this->storageStrategy = storage;

}

StorageStrategy * IndexStrategy::GetStorageStrategy() const {
	return this->storageStrategy;
}

/**
 * Workaround agregado, dado que las distintas estrategias de indexado comparten una misma interfaz, y su comportamiento no se el mismo
 * Problema de Arquitectura.
 */
int IndexStrategy::getClassName(){
	cout << "IndexStrategy::getClassName | Black Hole Pattern " << endl;
	return BlackHole;
}


Almacenamiento *IndexStrategy::getStorage() const{
	cout << "IndexStrategy::getStorage | Black Hole Pattern " << endl;
	return NULL;
}

void IndexStrategy::setStorage(Almacenamiento* storage){
	cout << "IndexStrategy::setStorage | Black Hole Pattern " << endl;
}
